﻿using System;

using E.BLL;
using E.Web.UI.Page;

using X.Common;

namespace E.Web.training.survey
{
    public partial class Redirect : BasePage
    {
        protected override void ShowPage()
        {
            int id = XRequest.GetInt("id", -1);
            int t = XRequest.GetInt("t", -1);
            int cid = XRequest.GetInt("cid", 1);
            if (id != -1)
            {
                if (t != -1)
                {
                    Utils.WriteCookie("t", t.ToString());
                }
                string href = "";
                switch ((E.Enum.EnumExamCategory)cid)
                { 
                    case E.Enum.EnumExamCategory.CourseExam:
                        href = "/training/exam/CourseSurvey.aspx?id=" + id + "&cid=" + cid;
                        break;
                    case E.Enum.EnumExamCategory.CertificateExam:
                        href = "/training/exam/CertificateSurvey.aspx?id=" + id + "&cid=" + cid;
                        break;
                    default:
                        break;
                }
                //System.Web.HttpContext.Current.Response.Redirect(href);
                ExecuteJS("window.location.replace('" + href + "');");
            }
            else
            {
                Alert("参数错误");
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}
